.class public Lcom/glympse/android/glympseservice/NotificationList;
.super Ljava/util/LinkedList;
.source "NotificationList.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/glympse/android/glympseservice/NotificationList$NotificationArrived;,
        Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;,
        Lcom/glympse/android/glympseservice/NotificationList$NotificationGlobal;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/util/LinkedList",
        "<",
        "Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;",
        ">;",
        "Ljava/lang/Runnable;"
    }
.end annotation


# instance fields
.field private m_nNextNotificationId:I

.field private m_oHandler:Landroid/os/Handler;

.field private m_oNotificationForeground:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

.field private m_oNotificationManager:Landroid/app/NotificationManager;


# direct methods
.method public constructor <init>()V
    .locals 4

    .prologue
    const/4 v0, 0x0

    .line 36
    invoke-direct {p0}, Ljava/util/LinkedList;-><init>()V

    .line 38
    iput-object v0, p0, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationManager:Landroid/app/NotificationManager;

    .line 39
    iput-object v0, p0, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationForeground:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    .line 40
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/glympse/android/glympseservice/NotificationList;->m_oHandler:Landroid/os/Handler;

    .line 48
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    const-wide/16 v2, 0x3e8

    div-long/2addr v0, v2

    long-to-int v0, v0

    const v1, 0x3fffffff

    and-int/2addr v0, v1

    iput v0, p0, Lcom/glympse/android/glympseservice/NotificationList;->m_nNextNotificationId:I

    .line 36
    return-void
.end method

.method static synthetic access$0(Lcom/glympse/android/glympseservice/NotificationList;)I
    .locals 1
    .parameter

    .prologue
    .line 48
    iget v0, p0, Lcom/glympse/android/glympseservice/NotificationList;->m_nNextNotificationId:I

    return v0
.end method

.method static synthetic access$1(Lcom/glympse/android/glympseservice/NotificationList;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 48
    iput p1, p0, Lcom/glympse/android/glympseservice/NotificationList;->m_nNextNotificationId:I

    return-void
.end method

.method static synthetic access$2(Lcom/glympse/android/glympseservice/NotificationList;)Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    .locals 1
    .parameter

    .prologue
    .line 39
    iget-object v0, p0, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationForeground:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    return-object v0
.end method

.method static synthetic access$3(Lcom/glympse/android/glympseservice/NotificationList;Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 39
    iput-object p1, p0, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationForeground:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    return-void
.end method


# virtual methods
.method public GetNotificationManager()Landroid/app/NotificationManager;
    .locals 2

    .prologue
    .line 53
    iget-object v0, p0, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationManager:Landroid/app/NotificationManager;

    if-nez v0, :cond_0

    .line 55
    sget-object v0, Lcom/glympse/android/glympseservice/GlympseService;->ms_oThis:Lcom/glympse/android/glympseservice/GlympseService;

    const-string v1, "notification"

    invoke-virtual {v0, v1}, Lcom/glympse/android/glympseservice/GlympseService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/NotificationManager;

    iput-object v0, p0, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationManager:Landroid/app/NotificationManager;

    .line 57
    :cond_0
    iget-object v0, p0, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationManager:Landroid/app/NotificationManager;

    return-object v0
.end method

.method public Remove(I)Z
    .locals 4
    .parameter "nNotificationId"

    .prologue
    .line 359
    const-string v2, "Removing Notification"

    invoke-static {v2}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 362
    const/4 v0, 0x0

    .line 363
    .local v0, oNotification:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    invoke-virtual {p0}, Lcom/glympse/android/glympseservice/NotificationList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_1

    .line 373
    :goto_0
    if-eqz v0, :cond_2

    .line 376
    invoke-static {v0}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->access$4(Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;)V

    .line 379
    invoke-virtual {p0, v0}, Lcom/glympse/android/glympseservice/NotificationList;->remove(Ljava/lang/Object;)Z

    .line 381
    const/4 v2, 0x1

    .line 383
    :goto_1
    return v2

    .line 363
    :cond_1
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    .line 365
    .local v1, oNotificationCur:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    iget v3, v1, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->m_nId:I

    if-ne v3, p1, :cond_0

    .line 367
    move-object v0, v1

    .line 368
    goto :goto_0

    .line 383
    .end local v1           #oNotificationCur:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    :cond_2
    const/4 v2, 0x0

    goto :goto_1
.end method

.method public Remove(J)Z
    .locals 5
    .parameter "lTicketId"

    .prologue
    .line 329
    const-string v2, "Removing Notification"

    invoke-static {v2}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 332
    const/4 v0, 0x0

    .line 333
    .local v0, oNotification:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    invoke-virtual {p0}, Lcom/glympse/android/glympseservice/NotificationList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_1

    .line 343
    :goto_0
    if-eqz v0, :cond_2

    .line 346
    invoke-static {v0}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->access$4(Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;)V

    .line 349
    invoke-virtual {p0, v0}, Lcom/glympse/android/glympseservice/NotificationList;->remove(Ljava/lang/Object;)Z

    .line 351
    const/4 v2, 0x1

    .line 353
    :goto_1
    return v2

    .line 333
    :cond_1
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    .line 335
    .local v1, oNotificationCur:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    invoke-virtual {v1}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->IsOngoing()Z

    move-result v3

    if-nez v3, :cond_0

    invoke-static {v1}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->access$2(Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;)J

    move-result-wide v3

    cmp-long v3, v3, p1

    if-nez v3, :cond_0

    .line 337
    move-object v0, v1

    .line 338
    goto :goto_0

    .line 353
    .end local v1           #oNotificationCur:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    :cond_2
    const/4 v2, 0x0

    goto :goto_1
.end method

.method public RemoveAll()V
    .locals 4

    .prologue
    .line 390
    invoke-virtual {p0}, Lcom/glympse/android/glympseservice/NotificationList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_0

    .line 396
    invoke-virtual {p0}, Lcom/glympse/android/glympseservice/NotificationList;->clear()V

    .line 402
    :try_start_0
    invoke-virtual {p0}, Lcom/glympse/android/glympseservice/NotificationList;->GetNotificationManager()Landroid/app/NotificationManager;

    move-result-object v2

    invoke-virtual {v2}, Landroid/app/NotificationManager;->cancelAll()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 408
    :goto_1
    return-void

    .line 390
    :cond_0
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    .line 392
    .local v1, oNotification:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    invoke-static {v1}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->access$4(Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;)V

    goto :goto_0

    .line 404
    .end local v1           #oNotification:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 406
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_1
.end method

.method public Update()V
    .locals 43

    .prologue
    .line 63
    const/16 v28, 0x0

    .line 64
    .local v28, fFoundForegroundNotification:Z
    const/16 v18, 0x0

    .line 66
    .local v18, oNotificationForegroundBest:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v8

    .line 67
    .local v8, lSystemTime:J
    invoke-static {v8, v9}, Lcom/glympse/platform/common/CorrectedTime;->GetTime(J)J

    move-result-wide v31

    .line 71
    .local v31, lCorrectedTime:J
    invoke-virtual/range {p0 .. p0}, Lcom/glympse/android/glympseservice/NotificationList;->iterator()Ljava/util/Iterator;

    move-result-object v4

    :goto_0
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-nez v5, :cond_7

    .line 76
    const-wide/16 v16, 0x0

    .line 77
    .local v16, lTotalRemaining:J
    const/4 v12, 0x0

    .local v12, nActiveTickets:I
    const/16 v35, 0x0

    .line 78
    .local v35, nEligibleTickets:I
    const/4 v13, 0x0

    .local v13, nWatchingTotal:I
    const/4 v14, 0x0

    .local v14, nHaveWatchedTotal:I
    const/4 v15, 0x0

    .line 81
    .local v15, nRecipientsTotal:I
    const/4 v4, 0x1

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v5

    iget-object v5, v5, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget v5, v5, Lcom/glympse/platform/Config;->m_eExpireOnArrival:I

    if-ne v4, v5, :cond_0

    .line 84
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v4

    iget-object v4, v4, Lcom/glympse/platform/Platform;->m_oSentTickets:Lcom/glympse/platform/common/SentTicketList;

    move-object v0, v4

    move-wide/from16 v1, v31

    invoke-virtual {v0, v1, v2}, Lcom/glympse/platform/common/SentTicketList;->CheckForArrival(J)Z

    .line 88
    :cond_0
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v4

    iget-object v4, v4, Lcom/glympse/platform/Platform;->m_oSentTickets:Lcom/glympse/platform/common/SentTicketList;

    iget-object v4, v4, Lcom/glympse/platform/common/SentTicketList;->m_listTickets:Lcom/glympse/platform/GVector$Tickets;

    invoke-virtual {v4}, Lcom/glympse/platform/GVector$Tickets;->iterator()Ljava/util/Iterator;

    move-result-object v11

    :cond_1
    :goto_1
    invoke-interface {v11}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-nez v4, :cond_8

    .line 236
    :cond_2
    if-nez v35, :cond_3

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v4

    iget-object v4, v4, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-wide v4, v4, Lcom/glympse/platform/Config;->m_lExpireTime:J

    const-wide/32 v6, 0xea60

    add-long/2addr v4, v6

    cmp-long v4, v4, v31

    if-lez v4, :cond_3

    .line 239
    add-int/lit8 v35, v35, 0x1

    .line 242
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v4

    iget-object v4, v4, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-wide v4, v4, Lcom/glympse/platform/Config;->m_lExpireTime:J

    cmp-long v4, v4, v31

    if-lez v4, :cond_12

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v4

    iget-object v4, v4, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-wide v4, v4, Lcom/glympse/platform/Config;->m_lExpireTime:J

    sub-long v4, v4, v31

    move-wide/from16 v16, v4

    .line 245
    :goto_2
    const-wide/16 v4, 0x0

    cmp-long v4, v16, v4

    if-lez v4, :cond_3

    .line 247
    add-int/lit8 v12, v12, 0x1

    .line 252
    :cond_3
    const/16 v30, 0x0

    .local v30, i:I
    :goto_3
    invoke-virtual/range {p0 .. p0}, Lcom/glympse/android/glympseservice/NotificationList;->size()I

    move-result v4

    move/from16 v0, v30

    move v1, v4

    if-lt v0, v1, :cond_13

    .line 288
    if-lez v35, :cond_4

    if-nez v18, :cond_4

    .line 290
    new-instance v18, Lcom/glympse/android/glympseservice/NotificationList$NotificationGlobal;

    .end local v18           #oNotificationForegroundBest:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    const/4 v4, 0x0

    move-object/from16 v0, v18

    move-object/from16 v1, p0

    move-object v2, v4

    invoke-direct {v0, v1, v2}, Lcom/glympse/android/glympseservice/NotificationList$NotificationGlobal;-><init>(Lcom/glympse/android/glympseservice/NotificationList;Lcom/glympse/android/glympseservice/NotificationList$NotificationGlobal;)V

    .restart local v18       #oNotificationForegroundBest:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    move-object/from16 v0, p0

    move-object/from16 v1, v18

    invoke-virtual {v0, v1}, Lcom/glympse/android/glympseservice/NotificationList;->add(Ljava/lang/Object;)Z

    .line 291
    const/16 v19, 0x0

    move/from16 v20, v12

    move/from16 v21, v13

    move/from16 v22, v14

    move/from16 v23, v15

    move-wide/from16 v24, v16

    move-wide/from16 v26, v8

    invoke-virtual/range {v18 .. v27}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->Update(Lcom/glympse/platform/common/Ticket;IIIIJJ)V

    .line 295
    :cond_4
    if-nez v28, :cond_5

    .line 298
    if-eqz v18, :cond_17

    .line 300
    move-object/from16 v0, v18

    move-object/from16 v1, p0

    iput-object v0, v1, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationForeground:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    .line 301
    sget-object v4, Lcom/glympse/android/glympseservice/GlympseService;->ms_oThis:Lcom/glympse/android/glympseservice/GlympseService;

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationForeground:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    move-object v5, v0

    iget v5, v5, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->m_nId:I

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationForeground:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    move-object v6, v0

    invoke-static {v4, v5, v6}, Lcom/glympse/platform/Reflection$_Service;->startForeground(Landroid/app/Service;ILandroid/app/Notification;)V

    .line 313
    :cond_5
    :goto_4
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/glympse/android/glympseservice/NotificationList;->m_oHandler:Landroid/os/Handler;

    move-object v4, v0

    move-object v0, v4

    move-object/from16 v1, p0

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    .line 314
    invoke-virtual/range {p0 .. p0}, Lcom/glympse/android/glympseservice/NotificationList;->isEmpty()Z

    move-result v4

    if-nez v4, :cond_6

    .line 316
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/glympse/android/glympseservice/NotificationList;->m_oHandler:Landroid/os/Handler;

    move-object v4, v0

    const-wide/16 v5, 0x3e8

    move-object v0, v4

    move-object/from16 v1, p0

    move-wide v2, v5

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 318
    :cond_6
    return-void

    .line 71
    .end local v12           #nActiveTickets:I
    .end local v13           #nWatchingTotal:I
    .end local v14           #nHaveWatchedTotal:I
    .end local v15           #nRecipientsTotal:I
    .end local v16           #lTotalRemaining:J
    .end local v30           #i:I
    .end local v35           #nEligibleTickets:I
    :cond_7
    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    .line 73
    .local v10, oNotificationCur:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    const/4 v5, 0x1

    invoke-static {v10, v5}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->access$1(Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;Z)V

    goto/16 :goto_0

    .line 88
    .end local v10           #oNotificationCur:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    .restart local v12       #nActiveTickets:I
    .restart local v13       #nWatchingTotal:I
    .restart local v14       #nHaveWatchedTotal:I
    .restart local v15       #nRecipientsTotal:I
    .restart local v16       #lTotalRemaining:J
    .restart local v35       #nEligibleTickets:I
    :cond_8
    invoke-interface {v11}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v42

    check-cast v42, Lcom/glympse/platform/common/Ticket;

    .line 91
    .local v42, oTicket:Lcom/glympse/platform/common/Ticket;
    move-object/from16 v0, v42

    iget-wide v0, v0, Lcom/glympse/platform/common/Ticket;->m_lExpireTime:J

    move-wide v4, v0

    const-wide/32 v6, 0xea60

    add-long/2addr v4, v6

    cmp-long v4, v4, v31

    if-lez v4, :cond_2

    .line 97
    move-object/from16 v0, v42

    iget-wide v0, v0, Lcom/glympse/platform/common/Ticket;->m_lExpireTime:J

    move-wide v4, v0

    cmp-long v4, v4, v31

    if-lez v4, :cond_e

    move-object/from16 v0, v42

    iget-wide v0, v0, Lcom/glympse/platform/common/Ticket;->m_lExpireTime:J

    move-wide v4, v0

    sub-long v4, v4, v31

    move-wide/from16 v33, v4

    .line 99
    .local v33, lRemaining:J
    :goto_5
    const/16 v38, 0x0

    .local v38, nWatching:I
    const/16 v36, 0x0

    .local v36, nHaveWatched:I
    const/16 v37, 0x0

    .line 104
    .local v37, nRecipients:I
    add-int/lit8 v35, v35, 0x1

    .line 107
    const-wide/16 v4, 0x0

    cmp-long v4, v33, v4

    if-lez v4, :cond_c

    .line 109
    add-int/lit8 v12, v12, 0x1

    .line 112
    move-object/from16 v0, v42

    iget-object v0, v0, Lcom/glympse/platform/common/Ticket;->m_listRecipients:Lcom/glympse/platform/GVector$Recipients;

    move-object v4, v0

    invoke-virtual {v4}, Lcom/glympse/platform/GVector$Recipients;->iterator()Ljava/util/Iterator;

    move-result-object v4

    :cond_9
    :goto_6
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-nez v5, :cond_f

    .line 131
    add-int v13, v13, v38

    .line 132
    add-int v14, v14, v36

    .line 133
    add-int v15, v15, v37

    .line 136
    const/4 v4, 0x1

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v5

    iget-object v5, v5, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget v5, v5, Lcom/glympse/platform/Config;->m_eExpireOnArrival:I

    if-ne v4, v5, :cond_c

    .line 139
    move-object/from16 v0, v42

    iget-boolean v0, v0, Lcom/glympse/platform/common/Ticket;->m_fArrived:Z

    move v4, v0

    if-eqz v4, :cond_c

    const-wide/16 v4, 0x0

    move-object/from16 v0, v42

    iget-wide v0, v0, Lcom/glympse/platform/common/Ticket;->m_lTicketId:J

    move-wide v6, v0

    cmp-long v4, v4, v6

    if-eqz v4, :cond_c

    .line 141
    const/16 v29, 0x0

    .line 144
    .local v29, fFoundNotificationArrived:Z
    invoke-virtual/range {p0 .. p0}, Lcom/glympse/android/glympseservice/NotificationList;->iterator()Ljava/util/Iterator;

    move-result-object v4

    :cond_a
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-nez v5, :cond_11

    .line 159
    :goto_7
    move-object/from16 v0, v42

    iget-boolean v0, v0, Lcom/glympse/platform/common/Ticket;->m_fArrivedNotification:Z

    move v4, v0

    if-nez v4, :cond_c

    .line 162
    if-nez v29, :cond_b

    .line 165
    new-instance v4, Lcom/glympse/android/glympseservice/NotificationList$NotificationArrived;

    move-object/from16 v0, v42

    iget-wide v0, v0, Lcom/glympse/platform/common/Ticket;->m_lTicketId:J

    move-wide v6, v0

    const/4 v10, 0x0

    move-object/from16 v5, p0

    invoke-direct/range {v4 .. v10}, Lcom/glympse/android/glympseservice/NotificationList$NotificationArrived;-><init>(Lcom/glympse/android/glympseservice/NotificationList;JJLcom/glympse/android/glympseservice/NotificationList$NotificationArrived;)V

    move-object/from16 v0, p0

    move-object v1, v4

    invoke-virtual {v0, v1}, Lcom/glympse/android/glympseservice/NotificationList;->add(Ljava/lang/Object;)Z

    .line 169
    :cond_b
    const/4 v4, 0x1

    move v0, v4

    move-object/from16 v1, v42

    iput-boolean v0, v1, Lcom/glympse/platform/common/Ticket;->m_fArrivedNotification:Z

    .line 176
    .end local v29           #fFoundNotificationArrived:Z
    :cond_c
    const/16 v39, 0x0

    .line 224
    .local v39, oNotification:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    cmp-long v4, v33, v16

    if-gtz v4, :cond_d

    const-wide/16 v4, 0x0

    cmp-long v4, v4, v16

    if-nez v4, :cond_1

    if-nez v18, :cond_1

    .line 226
    :cond_d
    move-wide/from16 v16, v33

    .line 227
    move-object/from16 v18, v39

    goto/16 :goto_1

    .line 97
    .end local v33           #lRemaining:J
    .end local v36           #nHaveWatched:I
    .end local v37           #nRecipients:I
    .end local v38           #nWatching:I
    .end local v39           #oNotification:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    :cond_e
    const-wide/16 v4, 0x0

    move-wide/from16 v33, v4

    goto/16 :goto_5

    .line 112
    .restart local v33       #lRemaining:J
    .restart local v36       #nHaveWatched:I
    .restart local v37       #nRecipients:I
    .restart local v38       #nWatching:I
    :cond_f
    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v41

    check-cast v41, Lcom/glympse/platform/common/Recipient;

    .line 114
    .local v41, oRecipient:Lcom/glympse/platform/common/Recipient;
    add-int/lit8 v37, v37, 0x1

    .line 117
    move-object/from16 v0, v41

    iget v0, v0, Lcom/glympse/platform/common/Recipient;->m_nUse:I

    move v5, v0

    if-lez v5, :cond_9

    .line 119
    add-int/lit8 v36, v36, 0x1

    .line 122
    move-object/from16 v0, v41

    iget-wide v0, v0, Lcom/glympse/platform/common/Recipient;->m_lLastUseTime:J

    move-wide v5, v0

    cmp-long v5, v5, v31

    if-gez v5, :cond_10

    .line 123
    move-object/from16 v0, v41

    iget-wide v0, v0, Lcom/glympse/platform/common/Recipient;->m_lLastUseTime:J

    move-wide v5, v0

    sub-long v5, v31, v5

    const-wide/32 v19, 0x2bf20

    cmp-long v5, v5, v19

    if-gtz v5, :cond_9

    .line 125
    :cond_10
    add-int/lit8 v38, v38, 0x1

    goto/16 :goto_6

    .line 144
    .end local v41           #oRecipient:Lcom/glympse/platform/common/Recipient;
    .restart local v29       #fFoundNotificationArrived:Z
    :cond_11
    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    .line 147
    .restart local v10       #oNotificationCur:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    invoke-static {v10}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->access$2(Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;)J

    move-result-wide v5

    move-object/from16 v0, v42

    iget-wide v0, v0, Lcom/glympse/platform/common/Ticket;->m_lTicketId:J

    move-wide/from16 v19, v0

    cmp-long v5, v5, v19

    if-nez v5, :cond_a

    invoke-virtual {v10}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->IsOngoing()Z

    move-result v5

    if-nez v5, :cond_a

    .line 150
    const/4 v4, 0x0

    invoke-static {v10, v4}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->access$1(Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;Z)V

    .line 153
    const/16 v29, 0x1

    .line 154
    goto/16 :goto_7

    .line 242
    .end local v10           #oNotificationCur:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    .end local v29           #fFoundNotificationArrived:Z
    .end local v33           #lRemaining:J
    .end local v36           #nHaveWatched:I
    .end local v37           #nRecipients:I
    .end local v38           #nWatching:I
    .end local v42           #oTicket:Lcom/glympse/platform/common/Ticket;
    :cond_12
    const-wide/16 v4, 0x0

    move-wide/from16 v16, v4

    goto/16 :goto_2

    .line 255
    .restart local v30       #i:I
    :cond_13
    move-object/from16 v0, p0

    move/from16 v1, v30

    invoke-virtual {v0, v1}, Lcom/glympse/android/glympseservice/NotificationList;->get(I)Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    .line 259
    .restart local v10       #oNotificationCur:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    if-lez v35, :cond_15

    if-nez v18, :cond_15

    const-wide/16 v4, 0x0

    invoke-static {v10}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->access$2(Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;)J

    move-result-wide v6

    cmp-long v4, v4, v6

    if-nez v4, :cond_15

    .line 261
    const/4 v4, 0x0

    invoke-static {v10, v4}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->access$1(Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;Z)V

    .line 262
    move-object/from16 v40, v10

    .line 265
    .end local v18           #oNotificationForegroundBest:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    .local v40, oNotificationForegroundBest:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationForeground:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    move-object v4, v0

    if-ne v10, v4, :cond_14

    .line 267
    const/16 v28, 0x1

    .line 271
    :cond_14
    const/4 v11, 0x0

    move-wide/from16 v18, v8

    invoke-virtual/range {v10 .. v19}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->Update(Lcom/glympse/platform/common/Ticket;IIIIJJ)V

    move-object/from16 v18, v40

    .line 275
    .end local v40           #oNotificationForegroundBest:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    .restart local v18       #oNotificationForegroundBest:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    :cond_15
    invoke-static {v10}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->access$3(Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;)Z

    move-result v4

    if-eqz v4, :cond_16

    .line 277
    invoke-static {v10}, Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;->access$4(Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;)V

    .line 278
    move-object/from16 v0, p0

    move/from16 v1, v30

    invoke-virtual {v0, v1}, Lcom/glympse/android/glympseservice/NotificationList;->remove(I)Ljava/lang/Object;

    goto/16 :goto_3

    .line 282
    :cond_16
    add-int/lit8 v30, v30, 0x1

    goto/16 :goto_3

    .line 305
    .end local v10           #oNotificationCur:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;
    :cond_17
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationForeground:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    move-object v4, v0

    if-eqz v4, :cond_5

    .line 307
    sget-object v4, Lcom/glympse/android/glympseservice/GlympseService;->ms_oThis:Lcom/glympse/android/glympseservice/GlympseService;

    const/4 v5, 0x1

    invoke-static {v4, v5}, Lcom/glympse/platform/Reflection$_Service;->stopForeground(Landroid/app/Service;Z)V

    .line 308
    const/4 v4, 0x0

    move-object v0, v4

    move-object/from16 v1, p0

    iput-object v0, v1, Lcom/glympse/android/glympseservice/NotificationList;->m_oNotificationForeground:Lcom/glympse/android/glympseservice/NotificationList$NotificationBase;

    goto/16 :goto_4
.end method

.method public run()V
    .locals 0

    .prologue
    .line 323
    invoke-virtual {p0}, Lcom/glympse/android/glympseservice/NotificationList;->Update()V

    .line 324
    return-void
.end method
